import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  routes: [{
    path: '*',
    redirect: '/'
  }, {
    path: '/',
    name: 'PageView',
    component: resolve => require(['@/view/PageView'], resolve),
    children: [{
      path: '/',
      redirect: '/home'
    }, {
      path: '/home',
      name: 'home',
      component: resolve => require(['@/view/HomePage'], resolve),
      meta: {
        title: '首页'
      }
    }, {
      path: '/software',
      name: 'software',
      component: resolve => require(['@/view/Software'], resolve),
      meta: {
        title: '宠物分类'
      },
      children: [{
        path: '/software',
        redirect: '/software/smartTown'
      },
      {
        path: '/software/smartTown',
        name: 'software',
        component: resolve => require(['@/view/Software_smartTown'], resolve),
        meta: {
          title: '宠物分类丨狗狗'
        }
      },
      {
        path: '/software/bigData',
        name: 'software',
        component: resolve => require(['@/view/Software_bigData'], resolve),
        meta: {
          title: '宠物分类丨猫咪'
        }
      }
      ]
    }, {
      path: '/service',
      name: 'service',
      component: resolve => require(['@/view/Service'], resolve),
      meta: {
        title: '相关服务'
      },
    }, {
      path: '/newsinformation',
      name: 'newsinformation',
      component: resolve => require(['@/view/NewsInformation'], resolve),
      meta: {
        title: '新闻动态'
      }
    },
    {
      path: '/forum',
      name: 'forum',
      component: resolve => require(['@/view/Forum'], resolve),
      meta: {
        title: '交流论坛'
      }
    },
    {
      path: '/shop',
      name: 'shop',
      component: resolve => require(['@/view/ShoppingList'], resolve),
      meta: {
        title: '宠物商城'
      }
    },
    {
      path: '/serviceList',
      name: 'serviceList',
      component: resolve => require(['@/view/ServiceList'], resolve),
      meta: {
        title: '服务预约'
      }
    }, {
      path: '/companyintroduction',
      name: 'companyintroduction',
      component: resolve => require(['@/view/CompanyIntroduction'], resolve),
      meta: {
        title: '公司介绍'
      }
    }, {
      path: '/jobchance',
      name: 'jobchance',
      component: resolve => require(['@/view/JobChance'], resolve),
      meta: {
        title: '工作机会'
      }
    }, {
      path: '/contactus',
      name: 'contactus',
      component: resolve => require(['@/view/ContactUs'], resolve),
      meta: {
        title: '联系我们'
      }
    },
    {
      path: '/servicedetail',
      name: 'servicedetail',
      component: resolve => require(['@/view/ServiceDetail'], resolve),
      meta: {
        title: '相关服务'
      }
    },
    {
      path: '/forumDetail/:id',
      name: 'forumDetail',
      component: resolve => require(['@/view/ForumDetail'], resolve),
      meta: {
        title: '帖子详情'
      }
    },
    {
      path: '/shop/:id',
      name: 'shopDetail',
      component: resolve => require(['@/view/ShopDetail'], resolve),
      meta: {
        title: '商品详情'
      }
    },
    {
      path: '/serviceOrderDetail/:id',
      name: 'serviceOrderDetail',
      component: resolve => require(['@/view/ServiceOrderDetail'], resolve),
      meta: {
        title: '服务详情'
      }
    },

    {
      path: "login",
      name: "login",
      component: () => import("@/view/user/Login")
    },
    {
      path: "register",
      name: "register",
      component: () => import("@/view/user/Register")
    },
    {
      path: "register-result",
      name: "registerResult",
      component: () => import("@/view/user/RegisterResult")
    }

    ]
  }]
})
